home *** CD-ROM | disk | FTP | other *** search
/ Almathera Ten Pack 4: Demo 1 / almathera_demo1.bin / amos / random numbers.amos / random numbers.amosSourceCode
AMOS Source Code  |  1995-03-16  |  595b  |  21 lines

  1. Dim N(21)
  2. ST:
  3. Locate 2,1 : Print "Selecting 20 different numbers"
  4. Locate 2,3 : Input "Press Return to Select Numbers";A$
  5. Cls 1
  6. Randomize Timer
  7. SA:
  8. Rem This decide show many numbers are selected 
  9. For D=1 To 20
  10. Rem this gives the total from which numbers are slected
  11. N=Int(Rnd(50))+1 : FLAG=0
  12. For H=1 To D-1
  13. If N(H)=N Then FLAG=1 : H=D
  14. Next H
  15. Rem  this checks to see if a number has already been chosen
  16. If FLAG=1 Then Goto SA
  17. N(D)=N
  18. Next D
  19.  Locate 2,6 : Print N(1);N(2);N(3);N(4);N(5);N(6);N(7);N(8);N(9);N(10)
  20. Locate 2,8 : Print N(11);N(12);N(13);N(14);N(15);N(16);N(17);N(18);N(19);N(20)
  21. Goto ST